import { prop } from "@typegoose/typegoose"


export class Subcode {

    //子码名称
    @prop({
        get(val) {
            return val
        },
        set(val) {
            return val.split('.')[0]
        }
    })
    public originalname: string

    //子码url
    @prop()
    public suburl: string

    //展现量（每日统计）
    @prop()
    public impression: number

    //总展现量
    @prop()
    public identifynum: number

    //今日点击次数
    @prop({ default: 0 })
    public todayclick?: number

    //总扫点击次数
    @prop({ default: 0 })
    public totalclick?: number

    //状态
    @prop()
    public status: boolean

    //路径
    @prop()
    public path: string

    //活码id
    @prop()
    public qrcodeid: string

    //用户id
    @prop()
    public userid: string

    //单个子码扫描最大值
    @prop()
    public restrictedmode: number

    //创建时间
    @prop()
    public time: number

    //长按识别次数
    @prop({ default: 0 })
    public spot?: number

    _id?: string

    // @prop()-
    // public qrcodes: [{ type: mongoose.Schema.Types.ObjectId, ref: 'Qrcode' }]

}